package com.briup.corejava.chap06.bean;

public class School {
    // 成员变量（属性）
    private String name;
    private int num;
    private String library;

    // 构造器（构造方法）
    // 一般情况下提供两个，空参、全参
    public School(){
        super();
    }
    public School(String name, int num, String library){
        this.name = name;
        this.num = num;
        this.library = library;
    }
    // 成员方法（行为）现在开始，一般不加static
    public void show(){
        System.out.println("学校："+name+"可容纳+"+num+"人,拥有图书馆："+library);
    }
    // 自动生成所有属性的getter & setter
    public String getLibrary() {
        return library;
    }

    public void setLibrary(String library) {
        this.library = library;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
